Skip to content

Fix #3533: Fix parsing of raw types appearing in generic position #3755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 8, 2018

Conversation

smarter
Copy link
Member

@smarter smarter commented Jan 4, 2018

No description provided.

Quoting from d8ff147:
    Legacy-tests seems to always compile files together, but cooking
    only works for Java files read by ClassfileParser. I don't think
    it makes sense to change that - if we compile Java files from sources
    we should demand that raw types are re-written as wildcard types.

Since other tests in the same situation will be added in the future, we
create a `pos-java-interop-separate` test folder to keep them together.
@smarter smarter requested a review from odersky January 4, 2018 21:43
@smarter smarter force-pushed the fix-raw-in-generic branch 2 times, most recently from 1eca461 to 34e3750 Compare January 4, 2018 22:09
if (isEnum) denot.info = ConstantType(Constant(sym))
if (isConstructor) normalizeConstructorParams()
setPrivateWithin(denot, jflags)
denot.info = translateTempPoly(parseAttributes(sym, denot.info))
denot.info = translateTempPoly(cook.apply(parseAttributes(sym, denot.info)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the change, the two applications of cook.apply are in 1-to-1 correspondence with the two calls to parseAttributes. Add the cook.apply to the result type of parseAttributes instead?

Otherwise LGTM

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, PR updated.

Only the ClassfileParser is fixed (because we can just ask users to fix
their Java source files to not use raw types to get them to compile with
Dotty). This means that the added Java testcase does not pass Dotty's
Java source parser, we handle this by putting "JAVA_ONLY" in the filename and
skipping files that contain this string from going through Dotty in our
testing framework.
@smarter smarter force-pushed the fix-raw-in-generic branch from 34e3750 to d19a792 Compare January 7, 2018 12:10
@smarter smarter merged commit 1a52057 into scala:master Jan 8, 2018
@allanrenucci allanrenucci deleted the fix-raw-in-generic branch January 8, 2018 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants